home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SunSoft Catalyst CDWARE 1996 May to August
/
Catalyst CDWARE 1996 May to August.iso
/
.products
/
.bin
/
httpd
/
Solaris_2
/
devinfo.pl
< prev
next >
Wrap
Perl Script
|
1996-02-26
|
1KB
|
49 lines
#!./perl
# ------------------------------------------------------------
# devinfo.pl, by Jean-Pierre Girard (jpg@corrado.sun.com)
# This allows the development Kit to choose what
# page to load depending on the existence of .devkit
# ------------------------------------------------------------
# Bugs and other fixes
# ------------------------------------------------------------
$DEVINFONAME=".devkit";
sub ComputeDevinfo
{
$BASEDIR = $ENV{"DOCUMENT_ROOT"};
$Devinfo=$BASEDIR . "/" . $DEVINFONAME;
}
sub PrintDevinfo
{
local($compdir, $status) = @_;
&ComputeDevinfo();
open(DEVINFO, ">$Devinfo");
#open(DEVINFO, ">$Devinfo") || die("Cannot open $Devinfo\n");
$old = select(DEVINFO);
print "$compdir^$status\n";
close(DEVINFO);
chmod(0666, $DevInfo);
select($old);
}
sub GetDevinfo
{
local($infoReq) = @_;
&ComputeDevinfo();
open(DEVINFO, "<$Devinfo");
#open(DEVINFO, "<$Devinfo") || die("Cannot read $Devinfo\n");
@Info = split(/\^/, <DEVINFO>);
if ($infoReq eq "dir") {
$Info[0];
} elsif ($infoReq eq "status") {
$Info[1];
}
}